const actions = {
    getBreadData(context, a) {
        const { breadData } = context.state
        let sum = 0
        breadData.forEach(p => {
            if (p.name == a.name) {
                sum++
            }
        });
        if (!sum) {
            context.commit('GETBREADDATA', a)
        }
    }
}
const mutations = {
    GETBREADDATA(state, value) {
        state.breadData.push(value)
    },
    MINBREADDATA(state, index) {
        state.breadData.splice(index, 1)
    }

}
const state = {
    breadData: [
        {
            name: '首页',
            path: '/main/home'
        }
    ]
}
const getters = {}
export default {
    namespaced: true,
    actions,
    mutations,
    state,
    getters
}